﻿using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    public float moveSpeed = 5f; // 移动速度

    private void Update()
    {
        float moveHorizontal = Input.GetAxis("Horizontal"); // 左右移动
        float moveVertical = Input.GetAxis("Vertical"); // 前后移动
        Vector3 movement = new Vector3(moveHorizontal, 0f, moveVertical);
        transform.position += movement * moveSpeed * Time.deltaTime;
    }
}